package com.bottomlord.session;

import javax.servlet.http.HttpSession;
import java.io.Serializable;

/**
 * @author ChenYue
 * @date 2021/5/12 21:43
 */
public class SessionInfo implements Serializable {
    private String id;

    private long creationTime;

    private long lastAccessedTime;

    private int maxInactiveInterval;

    public SessionInfo(){}

    public SessionInfo(HttpSession httpSession) {
        this.id = httpSession.getId();
        this.creationTime = httpSession.getCreationTime();
        this.lastAccessedTime = httpSession.getLastAccessedTime();
        this.maxInactiveInterval = httpSession.getMaxInactiveInterval();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public long getCreationTime() {
        return creationTime;
    }

    public void setCreationTime(long creationTime) {
        this.creationTime = creationTime;
    }

    public long getLastAccessedTime() {
        return lastAccessedTime;
    }

    public void setLastAccessedTime(long lastAccessedTime) {
        this.lastAccessedTime = lastAccessedTime;
    }

    public int getMaxInactiveInterval() {
        return maxInactiveInterval;
    }

    public void setMaxInactiveInterval(int maxInactiveInterval) {
        this.maxInactiveInterval = maxInactiveInterval;
    }
}
